package com.xyzh.stj.web.dao;

import com.xyzh.stj.web.entity.OrganizationEntity;
import com.xyzh.stj.web.vo.system.OrganizationPrems;
import com.xyzh.application.base.dao.BasicMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 组织机构 Mapper 接口
 * </p>
 *
 * @author @JZB
 * @since 2023-10-29
 */
public interface OrganizationMapper extends BasicMapper<OrganizationEntity> {

    List<OrganizationEntity> getOrganizationsByUser(@Param("userId") String userId);

    List<String> getSubOrgidsByParents(@Param("orgs") List<OrganizationEntity> orgs);

    List<String> getSubOrgidsByParentId(@Param("orgid") String orgid);

    List<OrganizationPrems> getSubOrgsByParentsWithPrems(@Param("orgs") List<OrganizationEntity> orgs, @Param("prem") boolean prem);

    List<OrganizationPrems> getParentOrgsBySubsWithPrems(@Param("orgs") List<OrganizationEntity> orgs, @Param("prem") boolean prem);

}
